<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero">
	<Style x:Key="ButtonFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Rectangle Margin="2"
                               StrokeThickness="1"
                               Stroke="Black"
                               StrokeDashArray="1 2"
                               SnapsToDevicePixels="true"/>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<LinearGradientBrush x:Key="ButtonNormalBackground"
                         StartPoint="0,0"
                         EndPoint="0,1">
		<LinearGradientBrush.GradientStops>
			<GradientStop Color="#F3F3F3"
                          Offset="0"/>
			<GradientStop Color="#EBEBEB"
                          Offset="0.5"/>
			<GradientStop Color="#DDDDDD"
                          Offset="0.5"/>
			<GradientStop Color="#CDCDCD"
                          Offset="1"/>
		</LinearGradientBrush.GradientStops>
	</LinearGradientBrush>
	<SolidColorBrush x:Key="ButtonNormalBorder"
                     Color="#FF707070"/>
	<Style x:Key="BaseButtonStyle"
           TargetType="{x:Type ButtonBase}">
		<Setter Property="FocusVisualStyle"
                Value="{StaticResource ButtonFocusVisual}"/>
		<Setter Property="Background"
                Value="{StaticResource ButtonNormalBackground}"/>
		<Setter Property="BorderBrush"
                Value="{StaticResource ButtonNormalBorder}"/>
		<Setter Property="BorderThickness"
                Value="1"/>
		<Setter Property="Foreground"
                Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
		<Setter Property="HorizontalContentAlignment"
                Value="Center"/>
		<Setter Property="VerticalContentAlignment"
                Value="Center"/>
		<Setter Property="Padding"
                Value="1"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ButtonBase}">
					<themes:ButtonChrome Name="Chrome"
                                        Background="{TemplateBinding Background}"
                                        BorderBrush="{TemplateBinding BorderBrush}"
                                        RenderDefaulted="{TemplateBinding Button.IsDefaulted}"
                                        RenderMouseOver="{TemplateBinding IsMouseOver}"
                                        RenderPressed="{TemplateBinding IsPressed}"
                                        SnapsToDevicePixels="true">
						<ContentPresenter Margin="{TemplateBinding Padding}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          RecognizesAccessKey="True"
                                          SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
					</themes:ButtonChrome>
					<ControlTemplate.Triggers>
						<Trigger Property="IsKeyboardFocused"
                                 Value="true">
							<Setter TargetName="Chrome"
                                    Property="RenderDefaulted"
                                    Value="true"/>
						</Trigger>
						<Trigger Property="ToggleButton.IsChecked"
                                 Value="true">
							<Setter TargetName="Chrome"
                                    Property="RenderPressed"
                                    Value="true"/>
						</Trigger>
						<Trigger Property="IsEnabled"
                                 Value="false">
							<Setter Property="Foreground"
                                    Value="#ADADAD"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="{x:Type ToggleButton}"
           BasedOn="{StaticResource BaseButtonStyle}"
           TargetType="{x:Type ToggleButton}"/>
	<Style x:Key="{x:Type RepeatButton}"
           BasedOn="{StaticResource BaseButtonStyle}"
           TargetType="{x:Type RepeatButton}">
		<Setter Property="Stylus.IsPressAndHoldEnabled"
                Value="false"/>
	</Style>
	<Style x:Key="{x:Type Button}"
           BasedOn="{StaticResource BaseButtonStyle}"
           TargetType="{x:Type Button}"/>

</ResourceDictionary>